package GUI;

import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;

public class PracticeJFrame extends JFrame{
    public static void main(String[] args) {
        new PracticeJFrame();

    }



    public PracticeJFrame(){
        //设置图片标签
        Image img = new ImageIcon("Class8_27/picture/R-C.jpg").getImage();
        img = img.getScaledInstance(240,200,1);

        JLabel imgJLabel = new JLabel(new ImageIcon(img));
        imgJLabel.setBounds(40,0,550,350);
        this.add(imgJLabel);

        //创建标签对象
        JLabel label = new JLabel("奖 金");
        label.setBounds(200,500,50,20);
        this.add(label);
        label.setFont(new Font("黑体",Font.BOLD,16));
        label.setForeground(Color.BLUE);

        JLabel label1 = new JLabel("通 缉 令");
        label1.setBounds(270,20,100,50);
        this.add(label1);
        label1.setFont(new Font("黑体",Font.BOLD,23));
        label1.setForeground(Color.RED);

        JLabel label2 = new JLabel("<html>  吴签<br>犯罪 牙签太小</html>");
        label2.setBounds(210,300,200,100);
        this.add(label2);
        label2.setFont(new Font("黑体",Font.BOLD,30));
        label2.setForeground(Color.RED);

        //设置复选框
        JComboBox box = new JComboBox(new String[]{"一级通缉犯","二级通缉犯","三级通缉犯"});
        box.setBounds(210,400,200,30);
        this.add(box);

        //设置复选框
        JCheckBox checkBox = new JCheckBox("同意协议");
        checkBox.setBounds(250,440,100,30);
        this.add(checkBox);


        //创建文本框对象
        JTextField jText = new JTextField();
        jText.setBounds(255,500,130,25);
        this.add(jText);


        //设置布局管理器
        this.setLayout(null);
        JButton b = new JButton("确定");
        b.setBounds(260,540,100,20);
        this.add(b);

        //设置窗体
        this.setSize(650,850);
        this.setVisible(true);
        this.setDefaultCloseOperation(3);
        this.setLocationRelativeTo(null);
    }


}
